<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  Text.ParserCombinators.ReadPrec</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2002</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  non-portable (uses Text.ParserCombinators.ReadP)</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- This library defines parser combinators for precedence parsing.</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.ParserCombinators.ReadPrec</span><span>
</span><span id="line-19"></span><span>  </span><span class="hs-special">(</span><span>
</span><span id="line-20"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier">ReadPrec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Precedences</span></span><span>
</span><span id="line-23"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#Prec"><span class="hs-identifier">Prec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#minPrec"><span class="hs-identifier">minPrec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Precedence operations</span></span><span>
</span><span id="line-27"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#lift"><span class="hs-identifier">lift</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#prec"><span class="hs-identifier">prec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#step"><span class="hs-identifier">step</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#reset"><span class="hs-identifier">reset</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Other operations</span></span><span>
</span><span id="line-33"></span><span>  </span><span class="annot"><span class="hs-comment">-- | All are based directly on their similarly-named 'ReadP' counterparts.</span></span><span>
</span><span id="line-34"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#get"><span class="hs-identifier">get</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#look"><span class="hs-identifier">look</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#%2B%2B%2B"><span class="hs-operator">(+++)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#%3C%2B%2B"><span class="hs-operator">(&lt;++)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#pfail"><span class="hs-identifier">pfail</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#choice"><span class="hs-identifier">choice</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Converters</span></span><span>
</span><span id="line-42"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#readPrec_to_P"><span class="hs-identifier">readPrec_to_P</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#readP_to_Prec"><span class="hs-identifier">readP_to_Prec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#readPrec_to_S"><span class="hs-identifier">readPrec_to_S</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#readS_to_Prec"><span class="hs-identifier">readS_to_Prec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>  </span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html"><span class="hs-identifier">Text.ParserCombinators.ReadP</span></a></span><span>
</span><span id="line-51"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier">ReadP</span></a></span><span>
</span><span id="line-52"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadS"><span class="hs-identifier">ReadS</span></a></span><span>
</span><span id="line-53"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#readP_to_S"><span class="hs-identifier">readP_to_S</span></a></span><span>
</span><span id="line-54"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#readS_to_P"><span class="hs-identifier">readS_to_P</span></a></span><span>
</span><span id="line-55"></span><span>  </span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html"><span class="hs-identifier">Text.ParserCombinators.ReadP</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">ReadP</span></span><span>
</span><span id="line-58"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier">get</span></a></span><span>
</span><span id="line-59"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier">look</span></a></span><span>
</span><span id="line-60"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator">(+++)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#%3C%2B%2B"><span class="hs-operator">(&lt;++)</span></a></span><span>
</span><span id="line-61"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier">pfail</span></a></span><span>
</span><span id="line-62"></span><span>  </span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Num.html"><span class="hs-identifier">GHC.Num</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Num.html#Num"><span class="hs-identifier">Num</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Monad.Fail.html"><span class="hs-identifier">Control.Monad.Fail</span></a></span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-70"></span><span class="hs-comment">-- The readPrec type</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-keyword">newtype</span><span> </span><span id="ReadPrec"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-var">ReadPrec</span></a></span></span><span> </span><span id="local-6989586621679494399"><span class="annot"><a href="#local-6989586621679494399"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="P"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#Prec"><span class="hs-identifier hs-type">Prec</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494399"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-comment">-- Functor, Monad, MonadPlus</span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-77"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679494287"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-78"></span><span>  </span><span id="local-6989586621679494283"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; ReadPrec a -&gt; ReadPrec b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679494282"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679494282"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494281"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494281"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP b) -&gt; ReadPrec b
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679494280"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494280"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; ReadP a -&gt; ReadP b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679494282"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494281"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494280"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-comment">-- | @since 4.6.0.0</span><span>
</span><span id="line-81"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679494271"><span id="local-6989586621679494273"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-82"></span><span>    </span><span id="local-6989586621679494267"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; ReadPrec a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679494266"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679494266"><span class="hs-identifier hs-var">x</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Prec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679494266"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span>    </span><span id="local-6989586621679494264"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. ReadPrec (a -&gt; b) -&gt; ReadPrec a -&gt; ReadPrec b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadPrec (a -&gt; b) -&gt; ReadPrec a -&gt; ReadPrec b
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#ap"><span class="hs-identifier hs-var">ap</span></a></span><span>
</span><span id="line-84"></span><span>    </span><span id="local-6989586621679494261"><span class="annot"><span class="annottext">liftA2 :: forall a b c.
(a -&gt; b -&gt; c) -&gt; ReadPrec a -&gt; ReadPrec b -&gt; ReadPrec c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftA2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; c) -&gt; ReadPrec a -&gt; ReadPrec b -&gt; ReadPrec c
forall (m :: * -&gt; *) a1 a2 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m r
</span><a href="GHC.Base.html#liftM2"><span class="hs-identifier hs-var">liftM2</span></a></span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-87"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679494252"><span id="local-6989586621679494254"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-88"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494248"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494248"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679494247"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. ReadPrec a -&gt; (a -&gt; ReadPrec b) -&gt; ReadPrec b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679494246"><span class="annot"><span class="annottext">a -&gt; ReadPrec b
</span><a href="#local-6989586621679494246"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP b) -&gt; ReadPrec b
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679494245"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494245"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679494244"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679494244"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494248"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494245"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494243"><span class="annot"><span class="annottext">Prec -&gt; ReadP b
</span><a href="#local-6989586621679494243"><span class="hs-identifier hs-var">f'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadPrec b
</span><a href="#local-6989586621679494246"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679494244"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP b
</span><a href="#local-6989586621679494243"><span class="hs-identifier hs-var">f'</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494245"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-91"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">MonadFail</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-92"></span><span>  </span><span id="local-6989586621679494235"><span class="annot"><span class="annottext">fail :: forall a. String -&gt; ReadPrec a
</span><a href="Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var hs-var hs-var hs-var">fail</span></a></span></span><span> </span><span id="local-6989586621679494234"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679494234"><span class="hs-identifier hs-var">s</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Prec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; ReadP a
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679494234"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-95"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679494226"><span id="local-6989586621679494228"><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span></span></span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-comment">-- | @since 4.6.0.0</span><span>
</span><span id="line-98"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679494217"><span id="local-6989586621679494219"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-99"></span><span>  </span><span id="local-6989586621679494215"><span class="annot"><span class="annottext">empty :: forall a. ReadPrec a
</span><a href="GHC.Base.html#empty"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadPrec a
forall a. ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span>
</span><span id="line-100"></span><span>  </span><span id="local-6989586621679494213"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. ReadPrec a -&gt; ReadPrec a -&gt; ReadPrec a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;|&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadPrec a -&gt; ReadPrec a -&gt; ReadPrec a
forall a. ReadPrec a -&gt; ReadPrec a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#%2B%2B%2B"><span class="hs-operator hs-var">(+++)</span></a></span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-comment">-- precedences</span><span>
</span><span id="line-103"></span><span class="hs-keyword">type</span><span> </span><span id="Prec"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#Prec"><span class="hs-identifier hs-var">Prec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#minPrec"><span class="hs-identifier hs-type">minPrec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#Prec"><span class="hs-identifier hs-type">Prec</span></a></span><span>
</span><span id="line-106"></span><span id="minPrec"><span class="annot"><span class="annottext">minPrec :: Prec
</span><a href="Text.ParserCombinators.ReadPrec.html#minPrec"><span class="hs-identifier hs-var hs-var">minPrec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Prec
</span><span class="hs-number">0</span></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- Operations over ReadPrec</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span id="local-6989586621679494354"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#lift"><span class="hs-identifier hs-type">lift</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494354"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494354"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-112"></span><span class="hs-comment">-- ^ Lift a precedence-insensitive 'ReadP' to a 'ReadPrec'.</span><span>
</span><span id="line-113"></span><span id="lift"><span class="annot"><span class="annottext">lift :: forall a. ReadP a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#lift"><span class="hs-identifier hs-var hs-var">lift</span></a></span></span><span> </span><span id="local-6989586621679494211"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679494211"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Prec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679494211"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span id="local-6989586621679494352"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#step"><span class="hs-identifier hs-type">step</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494352"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494352"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-116"></span><span class="hs-comment">-- ^ Increases the precedence context by one.</span><span>
</span><span id="line-117"></span><span id="step"><span class="annot"><span class="annottext">step :: forall a. ReadPrec a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#step"><span class="hs-identifier hs-var hs-var">step</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494207"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494207"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679494206"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494206"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494207"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494206"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Prec -&gt; Prec -&gt; Prec
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Prec
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span id="local-6989586621679494204"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#reset"><span class="hs-identifier hs-type">reset</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494204"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494204"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-120"></span><span class="hs-comment">-- ^ Resets the precedence context to zero.</span><span>
</span><span id="line-121"></span><span id="reset"><span class="annot"><span class="annottext">reset :: forall a. ReadPrec a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#reset"><span class="hs-identifier hs-var hs-var">reset</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494203"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494203"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Prec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494203"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="Text.ParserCombinators.ReadPrec.html#minPrec"><span class="hs-identifier hs-var">minPrec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span id="local-6989586621679494348"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#prec"><span class="hs-identifier hs-type">prec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#Prec"><span class="hs-identifier hs-type">Prec</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494348"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494348"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-124"></span><span class="hs-comment">-- ^ @(prec n p)@ checks whether the precedence context is</span><span>
</span><span id="line-125"></span><span class="hs-comment">--   less than or equal to @n@, and</span><span>
</span><span id="line-126"></span><span class="hs-comment">--</span><span>
</span><span id="line-127"></span><span class="hs-comment">--   * if not, fails</span><span>
</span><span id="line-128"></span><span class="hs-comment">--</span><span>
</span><span id="line-129"></span><span class="hs-comment">--   * if so, parses @p@ in context @n@.</span><span>
</span><span id="line-130"></span><span id="prec"><span class="annot"><span class="annottext">prec :: forall a. Prec -&gt; ReadPrec a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#prec"><span class="hs-identifier hs-var hs-var">prec</span></a></span></span><span> </span><span id="local-6989586621679494200"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494200"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494199"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494199"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679494198"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494198"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494198"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Prec -&gt; Prec -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494200"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494199"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494200"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">ReadP a
forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var">ReadP.pfail</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-133"></span><span class="hs-comment">-- Derived operations</span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#get"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-136"></span><span class="hs-comment">-- ^ Consumes and returns the next character.</span><span>
</span><span id="line-137"></span><span class="hs-comment">--   Fails if there is no input left.</span><span>
</span><span id="line-138"></span><span id="get"><span class="annot"><span class="annottext">get :: ReadPrec Char
</span><a href="Text.ParserCombinators.ReadPrec.html#get"><span class="hs-identifier hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP Char -&gt; ReadPrec Char
forall a. ReadP a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-var">ReadP.get</span></a></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#look"><span class="hs-identifier hs-type">look</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-141"></span><span class="hs-comment">-- ^ Look-ahead: returns the part of the input that is left, without</span><span>
</span><span id="line-142"></span><span class="hs-comment">--   consuming it.</span><span>
</span><span id="line-143"></span><span id="look"><span class="annot"><span class="annottext">look :: ReadPrec String
</span><a href="Text.ParserCombinators.ReadPrec.html#look"><span class="hs-identifier hs-var hs-var">look</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP String -&gt; ReadPrec String
forall a. ReadP a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier hs-var">ReadP.look</span></a></span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span id="local-6989586621679494196"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#%2B%2B%2B"><span class="hs-operator hs-type">(+++)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494196"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494196"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494196"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-146"></span><span class="hs-comment">-- ^ Symmetric choice.</span><span>
</span><span id="line-147"></span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494195"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494195"><span class="hs-identifier hs-var">f1</span></a></span></span><span> </span><span id="%2B%2B%2B"><span class="annot"><span class="annottext">+++ :: forall a. ReadPrec a -&gt; ReadPrec a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#%2B%2B%2B"><span class="hs-operator hs-var hs-var">+++</span></a></span></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494194"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494194"><span class="hs-identifier hs-var">f2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679494193"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494193"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494195"><span class="hs-identifier hs-var">f1</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494193"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">ReadP.+++</span></a></span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494194"><span class="hs-identifier hs-var">f2</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494193"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span id="local-6989586621679494192"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#%3C%2B%2B"><span class="hs-operator hs-type">(&lt;++)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494192"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494192"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494192"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-150"></span><span class="hs-comment">-- ^ Local, exclusive, left-biased choice: If left parser</span><span>
</span><span id="line-151"></span><span class="hs-comment">--   locally produces any result at all, then right parser is</span><span>
</span><span id="line-152"></span><span class="hs-comment">--   not used.</span><span>
</span><span id="line-153"></span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494191"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494191"><span class="hs-identifier hs-var">f1</span></a></span></span><span> </span><span id="%3C%2B%2B"><span class="annot"><span class="annottext">&lt;++ :: forall a. ReadPrec a -&gt; ReadPrec a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#%3C%2B%2B"><span class="hs-operator hs-var hs-var">&lt;++</span></a></span></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494190"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494190"><span class="hs-identifier hs-var">f2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679494189"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494189"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494191"><span class="hs-identifier hs-var">f1</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494189"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%3C%2B%2B"><span class="hs-operator hs-var">ReadP.&lt;++</span></a></span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494190"><span class="hs-identifier hs-var">f2</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494189"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span id="local-6989586621679494188"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#pfail"><span class="hs-identifier hs-type">pfail</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494188"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-156"></span><span class="hs-comment">-- ^ Always fails.</span><span>
</span><span id="line-157"></span><span id="pfail"><span class="annot"><span class="annottext">pfail :: forall a. ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#pfail"><span class="hs-identifier hs-var hs-var">pfail</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadPrec a
forall a. ReadP a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var">ReadP.pfail</span></a></span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span id="local-6989586621679494340"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#choice"><span class="hs-identifier hs-type">choice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494340"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494340"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-160"></span><span class="hs-comment">-- ^ Combines all parsers in the specified list.</span><span>
</span><span id="line-161"></span><span id="choice"><span class="annot"><span class="annottext">choice :: forall a. [ReadPrec a] -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#choice"><span class="hs-identifier hs-var hs-var">choice</span></a></span></span><span> </span><span id="local-6989586621679494187"><span class="annot"><span class="annottext">[ReadPrec a]
</span><a href="#local-6989586621679494187"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ReadPrec a -&gt; ReadPrec a -&gt; ReadPrec a)
-&gt; ReadPrec a -&gt; [ReadPrec a] -&gt; ReadPrec a
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">ReadPrec a -&gt; ReadPrec a -&gt; ReadPrec a
forall a. ReadPrec a -&gt; ReadPrec a -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#%2B%2B%2B"><span class="hs-operator hs-var">(+++)</span></a></span><span> </span><span class="annot"><span class="annottext">ReadPrec a
forall a. ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span> </span><span class="annot"><span class="annottext">[ReadPrec a]
</span><a href="#local-6989586621679494187"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-164"></span><span class="hs-comment">-- Converting between ReadPrec and Read</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span id="local-6989586621679494336"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#readPrec_to_P"><span class="hs-identifier hs-type">readPrec_to_P</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494336"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494336"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-167"></span><span id="readPrec_to_P"><span class="annot"><span class="annottext">readPrec_to_P :: forall a. ReadPrec a -&gt; Prec -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadPrec.html#readPrec_to_P"><span class="hs-identifier hs-var hs-var">readPrec_to_P</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494186"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494186"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494186"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-168"></span><span>
</span><span id="line-169"></span><span id="local-6989586621679494185"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#readP_to_Prec"><span class="hs-identifier hs-type">readP_to_Prec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494185"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494185"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-170"></span><span id="readP_to_Prec"><span class="annot"><span class="annottext">readP_to_Prec :: forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#readP_to_Prec"><span class="hs-identifier hs-var hs-var">readP_to_Prec</span></a></span></span><span> </span><span id="local-6989586621679494184"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494184"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494184"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span id="local-6989586621679494333"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#readPrec_to_S"><span class="hs-identifier hs-type">readPrec_to_S</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494333"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadS"><span class="hs-identifier hs-type">ReadS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494333"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-173"></span><span id="readPrec_to_S"><span class="annot"><span class="annottext">readPrec_to_S :: forall a. ReadPrec a -&gt; Prec -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadPrec.html#readPrec_to_S"><span class="hs-identifier hs-var hs-var">readPrec_to_S</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span id="local-6989586621679494183"><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494183"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679494182"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494182"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadS a
forall a. ReadP a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#readP_to_S"><span class="hs-identifier hs-var">readP_to_S</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Prec -&gt; ReadP a
</span><a href="#local-6989586621679494183"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494182"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span id="local-6989586621679494329"><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#readS_to_Prec"><span class="hs-identifier hs-type">readS_to_Prec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadS"><span class="hs-identifier hs-type">ReadS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494329"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679494329"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-176"></span><span id="readS_to_Prec"><span class="annot"><span class="annottext">readS_to_Prec :: forall a. (Prec -&gt; ReadS a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#readS_to_Prec"><span class="hs-identifier hs-var hs-var">readS_to_Prec</span></a></span></span><span> </span><span id="local-6989586621679494181"><span class="annot"><span class="annottext">Prec -&gt; ReadS a
</span><a href="#local-6989586621679494181"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Prec -&gt; ReadP a) -&gt; ReadPrec a
forall a. (Prec -&gt; ReadP a) -&gt; ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#P"><span class="hs-identifier hs-var">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679494180"><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494180"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ReadS a -&gt; ReadP a
forall a. ReadS a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#readS_to_P"><span class="hs-identifier hs-var">readS_to_P</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Prec -&gt; ReadS a
</span><a href="#local-6989586621679494181"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Prec
</span><a href="#local-6989586621679494180"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span></pre></body></html>